package br.com.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;

import br.com.bean.VeiculoBean;


public class VeiculoDAO {
	public void inserir(Connection conn, VeiculoBean value) throws Exception {


		String sql = "INSERT INTO veiculo(tipo, marca, modeloano, kminicial, funcionario, pintura,pisca, buzina, motor, lanterna, farol, pneus, obs)VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);";
		
		PreparedStatement ps = conn.prepareStatement(sql);
		ps.setString(1, value.getTipo());
		ps.setString(2, value.getMarca());
		ps.setString(3, value.getModeloAno());
		ps.setDouble(4, value.getKmInicial());
		ps.setInt(5, value.getFuncionario().getId());
		ps.setString(6, value.getPintura());
		ps.setString(7, value.getPisca());
		ps.setString(8, value.getBuzina());
		ps.setString(9, value.getMotor());
		ps.setString(10, value.getLanterna());
		ps.setString(11, value.getFarol());
		ps.setString(12, value.getPneus());
		ps.setString(13, value.getObs());
		ps.execute();
		ps.close();
	

}
}
